package com.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.provider.dao.TStoryDao;
import com.provider.entity.TStory;
import com.provider.service.TStoryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 项目Story任务(TStory)表服务实现类
 *
 * @author makejava
 * @since 2024-04-28 12:56:38
 */
@Service("tStoryService")
@Transactional(rollbackFor = Exception.class)
public class TStoryServiceImpl extends ServiceImpl<TStoryDao, TStory> implements TStoryService {

    @Override
    public List<TStory> queryStoryBySystemId(String systemId) {
        LambdaQueryWrapper<TStory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TStory::getSystemId, systemId).eq(TStory::getIsValid,"Y");
        return list(lambdaQueryWrapper);
    }

    @Override
    public List<TStory> queryAllStory() {
        LambdaQueryWrapper<TStory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.isNotNull(TStory::getSystemId).eq(TStory::getIsValid,"Y");
        return list(lambdaQueryWrapper);
    }
}

